package com.tron.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * Tron账户实体类
 */
@Data
@TableName(value ="tron_account")
public class TronAccount {
    //id
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    //地址
    @TableField(value = "address")
    private String address;

    //私钥
    @TableField(value = "private_key")
    private String privateKey;

    //余额
    @TableField(value = "balance")
    private Long balance;

    //创建时间
    @TableField(value = "create_date")
    private Date createDate;

    //是否可复用(0=否 1=是)
    @TableField(value = "is_reuse")
    private Integer isReuse;

    //是否在订单流程(0=否 1=是)
    @TableField(value = "is_order_flow")
    private Integer isOrderFlow;

    public TronAccount(String address, String privateKey, Long balance, Integer isReuse, Integer isOrderFlow) {
        this.address = address; //地址
        this.privateKey = privateKey; //私钥
        this.balance = balance; //余额
        this.createDate = new Date(); //创建时间
        this.isReuse = isReuse; //是否可复用
        this.isOrderFlow = isOrderFlow; //是否在走流程
    }

    public TronAccount(Long id, String address, String privateKey, Long balance, Date createDate, Integer isReuse, Integer isOrderFlow) {
        this.id = id;
        this.address = address;
        this.privateKey = privateKey;
        this.balance = balance;
        this.createDate = createDate;
        this.isReuse = isReuse;
        this.isOrderFlow = isOrderFlow;
    }

    public TronAccount() {
    }
}
